package com.xxxx;

import com.xxxx.dao.BookDao;
import com.xxxx.service.BookService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created By ShaoXikai on 2022/7/19
 */
public class TestApp {

    @Test
    public void test1() {
        ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext("ApplicationContext.xml");
        BookDao bookDao = ac.getBean("bookDao", BookDao.class);
        bookDao.m1();
        ac.close();
    }

    @Test
    public void test2() {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("ApplicationContext.xml");
        BookService bookService = applicationContext.getBean("bookService", BookService.class);
        bookService.save();
    }
}
